package aspecto.cript;

import orb.interoperabilidade.PDU;


public aspect Cripto {
	
	pointcut Encript():
		execution(* *.putRequestBody(*));
	before():Encript(){
		Object[] param = PDU.getParametros();
		Object[] paramNovo = new Object[param.length + 5];
		
		int cont = 0;
		for(int i =0; i < param.length; i++){
			paramNovo[i] = param[i];
			cont = i;
		}
		
		paramNovo[cont++] = new String("asfdjaksnd kndf bsadkfb");
		paramNovo[cont++] = new Integer(342);
		paramNovo[cont++] = new Double(30.2);
		
		PDU.setParametros(paramNovo);
	}
	
	pointcut Decript():
		execution(* *.readRequestBody());
	before():Decript(){
		Object[] paramCript = PDU.getParametros();
		Object[] paramDecript = new Object[paramCript.length - 5];
		
		for(int i = 0; i < paramDecript.length; i++){
			paramDecript[i] = paramCript[i];
		}
		
		PDU.setParametros(paramDecript);
	}

}
